/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ufop.controller;

import java.sql.Date;

import com.ufop.model.Dispositivo;
import com.ufop.view.SistemaVotoView;
import com.ufop.view.TesteComunicacaoView;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;

public class SistemaVotoController {
    protected SistemaVotoView svv;
    public static JDesktopPane desktop = new JDesktopPane();
    
    //telas - VIEWs
    private static TesteComunicacaoView testeDispView;
    
    public static void main(String[] args){
        new SistemaVotoController();       
    }

    public SistemaVotoController() {
     this.svv= new SistemaVotoView();
     this.svv.createAndShowGUI();
    }
    
   public static TesteComunicacaoView getTesteDispView(){
		if((testeDispView == null)||(testeDispView.isClosed())){
			//popular MODELO PAUTA
			Dispositivo d = new Dispositivo();
			DispositivoController dCtrl = new DispositivoController(d);
			testeDispView = new TesteComunicacaoView(dCtrl, d);
			desktop.add(testeDispView);
		}
		testeDispView.setVisible(false);
		testeDispView.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		return testeDispView;
	}
    
}
